showMapOverView = function() {
	var mapOverView = Ext.getCmp('overViewWin');
	var overViewMapIcon = Ext.getCmp('overViewMapIcon');
	if(languageName=='arabic'){
		mapOverView.setPosition(351,647);
	}else{
	mapOverView.setPosition(overViewMapIcon.getPosition()[0]
			+ overViewMapIcon.getWidth() - mapOverView.width, overViewMapIcon
			.getPosition()[1]
			- mapOverView.height + overViewMapIcon.getHeight() - 10);
	}
	mapOverView.show();
	overViewMapIcon.hide();
	Ext.each( [ 'mapLegend', 'mapLayers', 'mapMetaData' ], hideWindows);
};

// TODO : combine this later
showLegend = function() {
	var mapLegend = Ext.getCmp('mapLegend');
	if (mapLegend.isVisible()) {
		mapLegend.hide();
		return;
	}
	var legendMenu = Ext.getCmp('legendMenu');
	if(languageName=='arabic'){
		mapLegend.setPosition(231,571);
	}else{
	mapLegend.setPosition(legendMenu.getPosition()[0],
			legendMenu.getPosition()[1] - mapLegend.height);
	}
	mapLegend.show();
	Ext.each( [ 'overViewWin', 'mapLayers', 'mapMetaData' ], hideWindows);
};

showLayers = function() {
	var mapLayers = Ext.getCmp('mapLayers');
	if (mapLayers.isVisible()) {
		mapLayers.hide();
		return;
	}
	var layersMenu = Ext.getCmp('layersMenu');
	if(languageName=='arabic'){
		mapLayers.setPosition(117,571);
	}else{
	mapLayers.setPosition(layersMenu.getPosition()[0],
			layersMenu.getPosition()[1] - mapLayers.height);
	}
	mapLayers.show();
	Ext.each( [ 'overViewWin', 'mapLegend', 'mapMetaData' ], hideWindows);
};

showMetaData = function() {
	var window1 = Ext.getCmp('mapMetaData');
	if (window1.isVisible()) {
		window1.hide();
		return;
	}
	var menu = Ext.getCmp('overViewMapIcon');
	//var centerpanel  = Ext.getCmp('centerPanel');
	//menu.setPostion()
	//alert("x: " + menu.getPosition()[0] + "  y: " + (menu.getPosition()[1]-window1.height));
	if(languageName=='arabic'){
		window1.setPosition(10,710);
	}else{
		window1.setPosition(menu.getPosition()[0], menu.getPosition()[1] - window1.height);
	
	}
	window1.show();
	// hide other open windows
	Ext.each( [ 'overViewWin', 'mapLegend', 'mapLayers' ], hideWindows);
};

var bottomMapTools = new Ext.Toolbar( {
	items : [ '->', {
		xtype : 'tbbutton',
		id : 'overViewMapIcon',
		width : 22,
		height : 25,
		iconCls : 'arrow_bottomcls',
		iconAlign : 'top',
		shadow : false,
		animateTarget : 'overViewWin',
		qtip : 'OverView Map',
		listeners : {
			click : function() {
				showMapOverView();
			}
		}
	}, {
		xtype : 'tbbutton',
		id : 'legendMenu',
		iconCls : 'legend_tabcls',
		qtip : 'Legend',
		listeners : {
			click : function() {
				showLegend();
			}
		}
	}, {
		xtype : 'tbbutton',
		id : 'layersMenu',
		iconCls : 'layers_tabcls',
		qtip : 'Layers',
		listeners : {
			click : function() {
				Ext.get('layersDiv').show();
				showLayers();
			}
		}
	}, {
		xtype : 'tbbutton',
		id : 'metadataMenu',
		iconCls : 'metadata_tabcls',
		qtip : 'MetaData',
		listeners : {
			click : function() {
				showMetaData();
			}
		}
	} ]
});

var footer = {
	xtype : 'panel',
	layout : 'border',
	border : false,
	/* width : '100%', */
	height : 36,
	// cls : 'arrow_bottom',
	bodyStyle : 'background:transparent',
	items : [
	/*
	 * { region : 'north', height : 0, width : 0, border : false, bodyStyle :
	 * 'background:transparent', //items : [ bottomMapTools ] },
	 */
	{
		region : 'center',
		border : false,
		height : 36,
		cls : 'wrapper_footercls',
		html : '<span class="copyright_text">' + copyrightLabel
				+ ' | <a href="#" class="bottom_link"> ' + termsConditions
				+ '</a></span> '//
				// items : [ bottomMapTools ]
	} ]
};